package com.xs.tool.common.excel;


import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: SXD
 * @Description:
 * @Date: create in 2019/9/26 11:43
 */
@ColumnWidth(25)
public class ProSkuSearchInfoDisplay {

    /**
     * 促销ID
     */
    @ExcelProperty(value = "促销编码",index = 6)
    private String proId;

    /**
     * 参与类型
     */
    @ExcelIgnore
    private Integer itemType;

    /**
     * 商品sku 或  商品mc
     * DB查询出来的值
     */
    @ExcelIgnore
    private String itemCode;

    /**
     * 商品sku
     * 最终结果值
     */
    @ExcelProperty(value = "商品sku",index = 0)
    private Long sku;

    /**
     * 物料编码
     */
    @ExcelProperty(value = "物料编码",index = 1)
    private String matnrCode;

    /**
     * 商品名称
     */
    @ExcelProperty(value = "商品名称",index = 2)
    private String skuName;

    /**
     * 国条码
     */
    @ExcelProperty(value = "国条码",index = 3)
    private String barCode;
    /**
     * 商品MC
     * 最终结果值
     */
    @ExcelProperty(value = "商品MC",index = 4)
    private String skuMc;

    /**
     * 商品MC Name
     */
    @ExcelIgnore
    private String skuMcName;

    /**
     * 促销档期
     */
    @ExcelProperty(value = "促销档期",index = 5)
    private String  proSchedule;

    /**
     * 促销编码
     */
    @ExcelIgnore
    private String proCode;

    /**
     * 促销名称
     */
    @ExcelProperty(value = "促销名称",index =7)
    private String proName;

    /**
     * 促销详情
     */
    @ColumnWidth(50)
    @ExcelProperty(value = "促销详情",index =8)
    private String proDetail;

    /**
     * 促销类型
     */
    @ExcelIgnore
    private Integer proType;

    /**
     * 促销子类型
     */
    @ExcelIgnore
    private Integer proSubType;

    /**
     * 促销类型名称
     */
    @ExcelProperty(value = "促销类型",index =9)
    private String proTypeName;

    /**
     * 促销售价  单位：分
     */
    @ExcelProperty(value = "促销售价",index =10)
    private Double proPrice;

    /**
     * 促销折扣值
     * 仅单品促销实际应用本字段
     * 单品直降  101   skuPrice-rewardValue = proPrice
     * 单品特价  102   proPrice =  rewardValue
     * 单品折扣  103   skuPrice*（rewardValue/10000） =  proPrice
     */
    @ExcelIgnore
    private Long rewardValue;

    /**
     * 商品原价 单位：分
     */
    @ExcelProperty(value = "商品原价",index =11)
    private Double skuPrice;

    /**
     * 促销状态
     */
    @ExcelIgnore
    private Integer proStatus;

    /**
     * 促销状态名称
     */
    @ExcelProperty(value = "促销状态",index =12)
    private String proStatusName;

    /**
     * PO订单号  暂无
     * 采销系统相关
     */
    @ExcelIgnore
    private String poOrderCode;

    /**
     * STO订单号  暂无
     * 采销系统相关
     */
    @ExcelIgnore
    private String stoOrderCode;

    /**
     * 预期到店日  暂无
     * 采销系统相关
     */
    @ExcelIgnore
    private Date expectedDate;

    /**
     * 促销开始时间
     */
    @ExcelProperty(value = "促销开始时间",index =13)
    private Date proStartTime;

    /**
     * 促销结束时间
     */
    @ExcelProperty(value = "促销结束时间",index =14)
    private Date proEndTime;


    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public String getProTypeName() {
        return proTypeName;
    }

    public void setProTypeName(String proTypeName) {
        this.proTypeName = proTypeName;
    }

    public String getProStatusName() {
        return proStatusName;
    }

    public void setProStatusName(String proStatusName) {
        this.proStatusName = proStatusName;
    }

    public Date getProStartTime() {
        return proStartTime;
    }

    public void setProStartTime(Date proStartTime) {
        this.proStartTime = proStartTime;
    }

    public Date getProEndTime() {
        return proEndTime;
    }

    public void setProEndTime(Date proEndTime) {
        this.proEndTime = proEndTime;
    }

    public Long getRewardValue() {
        return rewardValue;
    }

    public void setRewardValue(Long rewardValue) {
        this.rewardValue = rewardValue;
    }

    public String getProId() {
        return proId;
    }

    public void setProId(String proId) {
        this.proId = proId;
    }

    public Long getSku() {
        if (sku == null){
            setSkuFromItemCode();
        }
        return sku;
    }

    public void setSkuFromItemCode(){
        setSku(Long.parseLong(itemCode));
    }

    public void setSku(Long sku) {
        this.sku = sku;
    }

    public Integer getItemType() {
        return itemType;
    }

    public void setItemType(Integer itemType) {
        this.itemType = itemType;
    }

    public String getItemCode() {
        return itemCode;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }

    public String getMatnrCode() {
        return matnrCode;
    }

    public void setMatnrCode(String matnrCode) {
        this.matnrCode = matnrCode;
    }

    public String getSkuName() {
        return skuName;
    }

    public void setSkuName(String skuName) {
        this.skuName = skuName;
    }

    public String getSkuMc() {
        return skuMc;
    }

    public void setSkuMc(String skuMc) {
        this.skuMc = skuMc;
    }

    public String getSkuMcName() {
        return skuMcName;
    }

    public void setSkuMcName(String skuMcName) {
        this.skuMcName = skuMcName;
    }

    public String getProSchedule() {
        return proSchedule;
    }

    public void setProSchedule(String proSchedule) {
        this.proSchedule = proSchedule;
    }

    public String getProCode() {
        return proCode;
    }

    public void setProCode(String proCode) {
        this.proCode = proCode;
    }

    public String getProName() {
        return proName;
    }

    public void setProName(String proName) {
        this.proName = proName;
    }

    public String getProDetail() {
        return proDetail;
    }

    public void setProDetail(String proDetail) {
        this.proDetail = proDetail;
    }

    public Integer getProType() {
        return proType;
    }

    public void setProType(Integer proType) {
        this.proType = proType;
    }

    public Integer getProSubType() {
        return proSubType;
    }

    public void setProSubType(Integer proSubType) {
        this.proSubType = proSubType;
    }

    public Double getProPrice() {
        return proPrice;
    }

    public void setProPrice(Double proPrice) {
        this.proPrice = proPrice;
    }

    public Double getSkuPrice() {
        return skuPrice;
    }

    public void setSkuPrice(Double skuPrice) {
        this.skuPrice = skuPrice;
    }

    public Integer getProStatus() {
        return proStatus;
    }

    public void setProStatus(Integer proStatus) {
        this.proStatus = proStatus;
    }

    public String getPoOrderCode() {
        return poOrderCode;
    }

    public void setPoOrderCode(String poOrderCode) {
        this.poOrderCode = poOrderCode;
    }

    public String getStoOrderCode() {
        return stoOrderCode;
    }

    public void setStoOrderCode(String stoOrderCode) {
        this.stoOrderCode = stoOrderCode;
    }

    public Date getExpectedDate() {
        return expectedDate;
    }

    public void setExpectedDate(Date expectedDate) {
        this.expectedDate = expectedDate;
    }
}
